<?php 
include TMPL_PATH.'public/header.phtml';
?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x" style="overflow:hidden;">
    	<div style="float:left;margin-right:50px;">
        <a href='<?php echo U('user/partner');?>'><em>会员列表</em></a><span>|</span>
        <a href='javascript:;' class="on" ><em>收货地址</em></a>
      </div>
      <div style="color:#000;">
       会员邮箱：<?php echo $user['email'];?>  &nbsp; &nbsp; &nbsp;<?php echo $user['username'];?>
      </div>
    </div>
</div>

<div class="pad_10">
<div class="table-list">
    <table width="100%" cellspacing="0" >
        <thead>
            <tr>
            <th align='center' width="5%">序号</th>
            <th align='center' width="10%">姓名</th>            
            <th align='center' width="10%">电话/手机</th>
            <th align='center' width="8%">E-mail</th> 
            <th align='center' width="26%">地址</th>           
            <th align='center' width="8%">邮编</th>
            <th align='center' width="8%">添加时间</th>
            <th align='center' >操作</th>
            </tr>
        </thead>
     <tbody>
   <?php 
   	if(isset($addressList) && $addressList):
   		foreach ($addressList as $v):
   ?>
			<tr>
                    <td align='center'><?php echo $k+1;?></td>
					<td align='center'><?php echo $v['delivery_first_name'] .' . '. $v['delivery_last_name'];?></td>
					<td align='center'><?php echo $v['delivery_phone'] . '  <br /> '. $v['delivery_moblie'];?></td>
					<td align='center'><?php echo $v['delivery_email']?></td>
					<td align='center'>
					<?php echo '[ '. $v['delivery_country']. ' - '. $v['delivery_province'] . ' - '. $v['delivery_city'] . ' ]';?><br/>
					<?php echo $v['delivery_address'];?>
					</td>                    
					<td align='center'><?php echo $v['delivery_postcode'];?></td>
					<td align='center'><?php echo date('Y-m-d H:i:s',$v['start_time']);?></td>
					<td align="center">
					    <!-- <?php if($v['default']==1){?><font color="red">√</font><?php }else{?><font color="blue">×</font><?php }?>-->
                        <a class="as" onclick="paListShow(this,<?php echo $v['id'];?>,'measure');" href="javascript:void(0);">身型信息</a>
                        &nbsp;&nbsp;|&nbsp;&nbsp;
                        <a class="as" onclick="paListShow(this,<?php echo $v['id'];?>,'order');" href="javascript:void(0);">订单信息</a>                      
                    </td>
				</tr>
			<tr class="trs" id="tr_<?php echo $v['id'];?>" style="display:none;">
                <td align='left' id="td_<?php echo $v['id'];?>" width="100%" colspan="8"></td>
		    </tr>                
	<?php 
		endforeach;
		endif;
	?>
   </tbody>
 </table>
</div>
</div>
</body>
</html>
<script type="text/javascript">
function paListShow(obj,id,type){
    $('.trs').not($(obj)).hide();paListShow_ajax(id,type);$('#tr_'+id).show();
}

function paListShow_ajax(id,type){
	var url = "<?php echo U('user/measure_info');?>";	
	if(type == 'order'){
	   url = "<?php echo U('order/order_list');?>";
	}
    $.ajax({
            type: 'POST',
            url: url,
            data: {"round":Math.random(),'address_id':id,'is_ajax':1},
            dataType:'html',
            beforeSend:function(){
				$('#td_'+id).html('<div style="text-align:center;font-size:14px;">正在努力加载 ^_^ <br />数据加载中，请稍后...</div>');	
			},
            success: function(msg) {
                 $('#td_'+id).html(msg);
            }
           });
}
</script>
